package tedu.study.ooday09;

public class MultiTypeDemo {
    public static void main(String[] args) {
        Aoo o = new Boo();
        Inter o1 = (Inter)o;
        Boo o2 = (Boo)o;
        //Coo o3 = (Coo)o;
        if(o instanceof Coo){
            Coo o3 = (Coo)o;
        }else{
            System.out.println("o不是Coo");
        }
        o2.a = 100;
        o2.b = 200;
        System.out.println(o.a);

        Aoo1 ao = new Aoo1();
        System.out.println(ao instanceof Aoo);
        System.out.println(ao instanceof Aoo1);
        //System.out.println(ao instanceof Aoo2);
        //System.out.println(ao instanceof Aoo3);
        System.out.println(ao instanceof Aoo11);
        System.out.println(ao instanceof Aoo111);
        System.out.println(ao instanceof Inter1);
        System.out.println(ao instanceof Inter2);
        //Aoo1 ao1 = (Aoo1)ao;
        //Aoo2 ao2 = (Aoo2)ao;
        //Aoo3 ao3 = (Aoo3)ao;
        //Aoo11 ao11 = (Aoo11)ao;
        Inter1 i1 = (Inter1)ao;
        System.out.println(i1.show());
    }
}
